package com.hikvision.rpq.sblearn.exception;

import com.hikvision.rpq.sblearn.common.IErrorCode;
import lombok.Data;

/**
 * @author renpeiqian
 * @date 2021/8/31 14:33
 * @since
 */
@Data
public class BusinessException extends RuntimeException  {

    private String code;

    private String message;


    public BusinessException(IErrorCode errorCode) {
        this.message =errorCode.getMessage();
        this.code =errorCode.getCode();
    }

    public BusinessException(IErrorCode errorCode,Throwable cause) {
        super(cause);
        this.code=errorCode.getCode();
        this.message =errorCode.getMessage();
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message) {
        super(message);
    }
    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }


}
